//
// Created on 2024/12/6.
//
// Node APIs are not fully supported. To solve the compilation error of the interface cannot be found,
// please include "napi/native_api.h".

#ifndef QT_FLUTTERBRIDGE_H
#define QT_FLUTTERBRIDGE_H
#include "napi/native_api.h"
#include <string>

namespace FB {
class FlutterBridge {
public:
    //ArkTS调用NAPI
    static napi_value attach(napi_env env, napi_callback_info info);
    static napi_value notifyWindowCreated(napi_env env, napi_callback_info info);
    static napi_value dispatchMessage(napi_env env, napi_callback_info info);

    //C++调用到ArkTS
    static void createFlutterWindow();
    static void handleMessage(const std::string &handler, const std::string &fun, const void* message);

private:
    static napi_env g_env;
    static napi_ref g_ref_napi_obj;
};
}
#endif //QT_FLUTTERBRIDGE_H
